﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NJL.WebMembers.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Cache-Control" content="no-cache" />
    <title>个人首页</title>
    <link rel="stylesheet" type="text/css" href="/Styles/base.css" />
    <script type="text/javascript" src="/scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">

        var pageIndex = 1;  //当前页索引
        var pageSize = 10;   //页大小
        var type = 1;       //栏目类型1,首页,2好吃的,3好玩的,4活动，5特产。
        $(document).ready(function () {
            getNewsList(); //默认调用首页
            //首页
            $('#default').click(function () {
                DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                fclassName('defaultclass'); //设置样式
                closePopupDiv();            //隐藏div
                pageIndex = 1;
                type = 1;
                getNewsList();
            });
            //好吃的
            $('#eat').click(function () {
                DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                fclassName('eatclass');
                closePopupDiv();            //隐藏div
                pageIndex = 1;
                type = 2;
                eatList();
            });
            //好玩的
            $('#play').click(function () {
                DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                fclassName('playclass');
                closePopupDiv();            //隐藏div
                pageIndex = 1;
                type = 3;
                playList();
            });
            //活动
            $('#active').click(function () {
                DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                fclassName('activeclass');
                closePopupDiv();            //隐藏div
                pageIndex = 1;
                type = 4;
                ActiveList();
            });
            //特产
            $('#shop').click(function () {
                DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                fclassName('techanclass');
                closePopupDiv();            //隐藏div
                pageIndex = 1;
                type = 5;
                shopList();
            });
            //首页
            $('#firstPage').click(function () {
                if (pageIndex > 1) {
                    pageIndex = 1;
                    switch (type) {
                        case 1:
                            getNewsList();
                            break;
                        case 2:
                            eatList();
                            break;
                        case 3:
                            playList();
                            break;
                        case 4:
                            ActiveList();
                            break;
                        case 5:
                            shopList();
                            break;
                        default:
                            getNewsList();
                            break;
                    }

                    DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                }
            });
            //上一页
            $('#PrevPage').click(function () {
                if (pageIndex > 1) {
                    pageIndex -= 1;
                    switch (type) {
                        case 1:
                            getNewsList();
                            break;
                        case 2:
                            eatList();
                            break;
                        case 3:
                            playList();
                            break;
                        case 4:
                            ActiveList();
                            break;
                        case 5:
                            shopList();
                            break;
                        default:
                            getNewsList();
                            break;
                    }
                    DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                }
            });
            //下一页
            $('#nextPage').click(function () {
                if (pageIndex < $('#hidPageCount').val()) {
                    pageIndex += 1;
                    switch (type) {
                        case 1:
                            getNewsList();
                            break;
                        case 2:
                            eatList();
                            break;
                        case 3:
                            playList();
                            break;
                        case 4:
                            ActiveList();
                            break;
                        case 5:
                            shopList();
                            break;
                        default:
                            getNewsList();
                            break;
                    }
                    DEFAULT_MAIN_LIST_TO_TOP(); //置顶

                }
            });
            //末页
            $('#endPage').click(function () {
                if (pageIndex < $('#hidPageCount').val()) {
                    pageIndex = $('#hidPageCount').val();
                    switch (type) {
                        case 1:
                            getNewsList();
                            break;
                        case 2:
                            eatList();
                            break;
                        case 3:
                            playList();
                            break;
                        case 4:
                            ActiveList();
                            break;
                        case 5:
                            shopList();
                            break;
                        default:
                            getNewsList();
                            break;
                    }
                    DEFAULT_MAIN_LIST_TO_TOP(); //置顶
                }
            });
            //个人信息
            $('#edituserinfo').click(function () {
                getUserInfo();
            });

        });
        var getUserInfo = function () {
            $.ajax({
                type: 'get',
                cache: false,
                url: '/HtmlTemplates/Edit_User_Info.html',
                dataType: 'html',
                success: function (result) {
                    $('#newscontent').html(result);
                    var todayear = new Date();
                    for (var i = todayear.getFullYear(); i >= 1900; i--) {
                        document.getElementById("slectYear").options.add(new Option(i + '年', '' + i));
                    }
                    for (var i = 1; i <= 12; i++) {
                        if (i < 10) {
                            document.getElementById("selectMonth").options.add(new Option(i + '月', '0' + i));
                        }
                        else {
                            document.getElementById("selectMonth").options.add(new Option(i + '月', '' + i));
                        }
                    }
                    //月选择事件
                    $('#selectMonth').change(function () {
                        yearMonth();
                    });
                    //年选择事件
                    $('#slectYear').change(function () {
                        yearMonth();
                    });

                    //加载喜好
                    getLikes();
                    //加载用户信息
                    getUserInfoByUserId();
                    //加载个人信息
                    getPersonInfoByUserId();
                    //提交
                    $('#btnSubmit').click(function () {
                        editUserAndPersonInfo();

                    });
                    //上传
                    $('#bntUpload').click(function () {
                        var fileUpload1 = $('#fileUpload').val();
                        if ($.trim(fileUpload1).length == 0) {
                            alert("请上传文件哦");
                            return false;
                        }
                        var fileOk1 = false;
                        var fileExtension1 = fileUpload1.substring(fileUpload1.lastIndexOf('.')).toLowerCase();
                        var allowedExtensions = new Array(".jpg", ".gif", ".jpeg");
                        for (var i in allowedExtensions) {
                            if (allowedExtensions[i] == fileExtension1) {
                                fileOk1 = true;
                            }
                        }
                        if (!fileOk1) {
                            alert("只能上传.jpg、.gif格式的图片文件哦");
                            return false;
                        }
                        $('#form1').submit(); //上传提交
                    });
                    //选项卡切换
                    jQuery('#userInfo').click(function () {
                        $('#btnSubmit').show();
                        userinfoTab('divuserInfo');
                    });
                    jQuery('#detailsInfo').click(function () {
                        $('#btnSubmit').show();
                        userinfoTab('divdetailsInfo');
                    });
                    jQuery('#userHeadInfo').click(function () {

                        userinfoTab('divuserHeadInfo');
                        $('#btnSubmit').hide();
                    });

                },
                error: function () {

                }
            });
        }
        var userinfoTab = function (objId) {
            $('#divuserInfo').hide();
            $('#divdetailsInfo').hide();
            $('#divuserHeadInfo').hide();
            $('#' + objId).show();

        }
        //判断年月日
        var yearMonth = function () {
            document.getElementById("selectDate").options.length = 1;
            var selYear = $('#slectYear').val();
            var selMonth = $('#selectMonth').val();
            if (selMonth == 1 || selMonth == 3 || selMonth == 5 || selMonth == 7 || selMonth == 10 || selMonth == 11) {
                for (var i = 1; i <= 31; i++) {
                    if (i < 10) {
                        document.getElementById("selectDate").options.add(new Option(i + '日', '0' + i));
                    }
                    else {
                        document.getElementById("selectDate").options.add(new Option(i + '日', '' + i));
                    }
                }
            }
            //判断2月份
            else if (selMonth == 2) {
                if (selYear != '') {
                    //判断是不是闰年
                    if ((selYear % 400 == 0) || (selYear % 100 != 0) && (selYear % 4 == 0)) {
                        for (var i = 1; i <= 29; i++) {
                            if (i < 10) {
                                document.getElementById("selectDate").options.add(new Option(i + '日', '0' + i));
                            }
                            else {
                                document.getElementById("selectDate").options.add(new Option(i + '日', '' + i));
                            }
                        }
                    }
                    else {
                        for (var i = 1; i <= 28; i++) {
                            if (i < 10) {
                                document.getElementById("selectDate").options.add(new Option(i + '日', '0' + i));
                            }
                            else {
                                document.getElementById("selectDate").options.add(new Option(i + '日', '' + i));
                            }
                        }
                    }
                }
                else {

                }
            }
            else {
                for (var i = 1; i <= 30; i++) {
                    if (i < 10) {
                        document.getElementById("selectDate").options.add(new Option(i + '日', '0' + i));
                    }
                    else {
                        document.getElementById("selectDate").options.add(new Option(i + '日', '' + i));
                    }
                }
            }
        }

        //首页列表
        var getNewsList = function () {
            if (pageIndex == 1) {
                $('#firstPage').attr("disabled", function () { return "disabled" });
                $('#firstPage').removeAttr("href");
                $('#PrevPage').attr("disabled", function () { return "disabled" });
                $('#PrevPage').removeAttr("href");
            }
            else {
                $('#firstPage').removeAttr("disabled");
                $('#firstPage').attr("href", function () { return "javascript:void(0);" });
                $('#PrevPage').removeAttr("disabled");
                $('#PrevPage').attr("href", function () { return "javascript:void(0);" });
            }
            if (pageIndex == $('#hidPageCount').val()) {
                $('#nextPage').attr("disabled", function () { return "disabled" });
                $('#nextPage').removeAttr("href");
                $('#endPage').attr("disabled", function () { return "disabled" });
                $('#endPage').removeAttr("href");
            }
            else {
                $('#nextPage').removeAttr("disabled");
                $('#nextPage').attr("href", function () { return "javascript:void(0);" });
                $('#endPage').removeAttr("disabled");
                $('#endPage').attr("href", function () { return "javascript:void(0);" });
            }
            //加载首页列表
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/GetNewsListStr',
                data: '{pageSize:' + pageSize + ',pageIndex:' + pageIndex + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newscontent').html(result.d['Content']);
                    $('#hidPageCount').val(result.d['PageCount']);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });

        }
        //游记内容
        var newsContent = function (newsId) {
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/GetNewsContent',
                data: '{newsId:' + newsId + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newsContent').hide();
                    $('#newsContent').html(result.d);
                    $('#newsContent').show('slow', '');
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
            newsComment(newsId);
            openPopupDiv();
        }
        //游记评论
        var newsComment = function (newsId) {
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=ftf-8',
                url: '/WebService/WebService.asmx/GetNewsComment',
                data: '{newsId:' + newsId + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newsComment').html(result.d);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //好吃的列表
        var eatList = function () {
            if (pageIndex == 1) {
                $('#firstPage').attr("disabled", function () { return "disabled" });
                $('#firstPage').removeAttr("href");
                $('#PrevPage').attr("disabled", function () { return "disabled" });
                $('#PrevPage').removeAttr("href");
            }
            else {
                $('#firstPage').removeAttr("disabled");
                $('#firstPage').attr("href", function () { return "javascript:void(0);" });
                $('#PrevPage').removeAttr("disabled");
                $('#PrevPage').attr("href", function () { return "javascript:void(0);" });
            }
            if (pageIndex == $('#hidPageCount').val()) {
                $('#nextPage').attr("disabled", function () { return "disabled" });
                $('#nextPage').removeAttr("href");
                $('#endPage').attr("disabled", function () { return "disabled" });
                $('#endPage').removeAttr("href");
            }
            else {
                $('#nextPage').removeAttr("disabled");
                $('#nextPage').attr("href", function () { return "javascript:void(0);" });
                $('#endPage').removeAttr("disabled");
                $('#endPage').attr("href", function () { return "javascript:void(0);" });
            }
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/EatList',
                data: '{pageSize:' + pageSize + ',pageIndex:' + pageIndex + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newscontent').html(result.d['Content']);
                    $('#hidPageCount').val(result.d['PageCount']);
                    $('#Loading').hide();
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        // 好吃的内容
        var eatContent = function (id) {
            openPopupDiv();
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/GetEatContent',
                data: '{Id:' + id + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newsContent').hide();
                    $('#newsContent').html(result.d);
                    $('#newsContent').show('slow', '');
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
            eatComment(id);
        }
        //好吃的评论
        var eatComment = function (Id) {
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=ftf-8',
                url: '/WebService/WebService.asmx/GetEatComment',
                data: '{Id:' + Id + '}',
                dataType: 'json',
                success: function (result) {
                    openPopupDiv();
                    $('#newsComment').html(result.d);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //好玩的列表
        var playList = function () {
            if (pageIndex == 1) {
                $('#firstPage').attr("disabled", function () { return "disabled" });
                $('#firstPage').removeAttr("href");
                $('#PrevPage').attr("disabled", function () { return "disabled" });
                $('#PrevPage').removeAttr("href");
            }
            else {
                $('#firstPage').removeAttr("disabled");
                $('#firstPage').attr("href", function () { return "javascript:void(0);" });
                $('#PrevPage').removeAttr("disabled");
                $('#PrevPage').attr("href", function () { return "javascript:void(0);" });
            }
            if (pageIndex == $('#hidPageCount').val()) {
                $('#nextPage').attr("disabled", function () { return "disabled" });
                $('#nextPage').removeAttr("href");
                $('#endPage').attr("disabled", function () { return "disabled" });
                $('#endPage').removeAttr("href");
            }
            else {
                $('#nextPage').removeAttr("disabled");
                $('#nextPage').attr("href", function () { return "javascript:void(0);" });
                $('#endPage').removeAttr("disabled");
                $('#endPage').attr("href", function () { return "javascript:void(0);" });
            }
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/PlayList',
                data: '{pageSize:' + pageSize + ',pageIndex:' + pageIndex + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newscontent').html(result.d['Content']);
                    $('#hidPageCount').val(result.d['PageCount']);
                    $('#Loading').hide();
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //买特产列表
        var shopList = function () {
            if (pageIndex == 1) {
                $('#firstPage').attr("disabled", function () { return "disabled" });
                $('#firstPage').removeAttr("href");
                $('#PrevPage').attr("disabled", function () { return "disabled" });
                $('#PrevPage').removeAttr("href");
            }
            else {
                $('#firstPage').removeAttr("disabled");
                $('#firstPage').attr("href", function () { return "javascript:void(0);" });
                $('#PrevPage').removeAttr("disabled");
                $('#PrevPage').attr("href", function () { return "javascript:void(0);" });
            }
            if (pageIndex == $('#hidPageCount').val()) {
                $('#nextPage').attr("disabled", function () { return "disabled" });
                $('#nextPage').removeAttr("href");
                $('#endPage').attr("disabled", function () { return "disabled" });
                $('#endPage').removeAttr("href");
            }
            else {
                $('#nextPage').removeAttr("disabled");
                $('#nextPage').attr("href", function () { return "javascript:void(0);" });
                $('#endPage').removeAttr("disabled");
                $('#endPage').attr("href", function () { return "javascript:void(0);" });
            }
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/LocalColorList',
                data: '{pageSize:' + pageSize + ',pageIndex:' + pageIndex + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newscontent').html(result.d['Content']);
                    $('#hidPageCount').val(result.d['PageCount']);
                    $('#Loading').hide();
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }

        // 买特产内容
        var shopContent = function (id) {
            openPopupDiv();
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/LocalColorContent',
                data: '{Id:' + id + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newsContent').hide();
                    $('#newsContent').html(result.d);
                    $('#newsContent').show('slow', '');
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
            shopComment(id);
        }
        //买特产评论
        var shopComment = function (Id) {
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=ftf-8',
                url: '/WebService/WebService.asmx/LocalColorComment',
                data: '{Id:' + Id + '}',
                dataType: 'json',
                success: function (result) {
                    openPopupDiv();
                    $('#newsComment').html(result.d);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //活动列表
        var ActiveList = function () {
            if (pageIndex == 1) {
                $('#firstPage').attr("disabled", function () { return "disabled" });
                $('#firstPage').removeAttr("href");
                $('#PrevPage').attr("disabled", function () { return "disabled" });
                $('#PrevPage').removeAttr("href");
            }
            else {
                $('#firstPage').removeAttr("disabled");
                $('#firstPage').attr("href", function () { return "javascript:void(0);" });
                $('#PrevPage').removeAttr("disabled");
                $('#PrevPage').attr("href", function () { return "javascript:void(0);" });
            }
            if (pageIndex == $('#hidPageCount').val()) {
                $('#nextPage').attr("disabled", function () { return "disabled" });
                $('#nextPage').removeAttr("href");
                $('#endPage').attr("disabled", function () { return "disabled" });
                $('#endPage').removeAttr("href");
            }
            else {
                $('#nextPage').removeAttr("disabled");
                $('#nextPage').attr("href", function () { return "javascript:void(0);" });
                $('#endPage').removeAttr("disabled");
                $('#endPage').attr("href", function () { return "javascript:void(0);" });
            }
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/ActiveList',
                data: '{pageSize:' + pageSize + ',pageIndex:' + pageIndex + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newscontent').html(result.d['Content']);
                    $('#hidPageCount').val(result.d['PageCount']);
                    $('#Loading').hide();
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        // 活动内容
        var activeContent = function (id) {
            openPopupDiv();
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                url: '/WebService/WebService.asmx/ActiveContent',
                data: '{Id:' + id + '}',
                dataType: 'json',
                success: function (result) {
                    $('#newsContent').hide();
                    $('#newsContent').html(result.d);
                    $('#newsContent').show('slow', '');
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
            activeComment(id);
        }
        //活动评论
        var activeComment = function (Id) {
            $.ajax({
                type: 'post',
                contentType: 'application/json;charset=ftf-8',
                url: '/WebService/WebService.asmx/ActiveComment',
                data: '{Id:' + Id + '}',
                dataType: 'json',
                success: function (result) {
                    openPopupDiv();
                    $('#newsComment').html(result.d);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        var fclassName = function (classId) {
            $('#defaultclass').removeAttr("class");
            $('#eatclass').removeAttr("class");
            $('#playclass').removeAttr("class");
            $('#activeclass').removeAttr("class");
            $('#techanclass').removeAttr("class");
            $('#' + classId).attr("class", function () { return "now" });
        }
        //加载用户信息
        var getUserInfoByUserId = function () {
            $.ajax({
                type: 'get',
                url: '/WebService/WebService.asmx/GetUserModel',
                contentType: 'application/json;charset=utf-8',
                data: '{}',
                dataType: 'json',
                success: function (result) {
                    $('#email').html(result.d['EMAIL']);
                    $('#txtuserName').val(result.d['USER_NAME']);
                    $('#txtMobel').val(result.d['MOBILE']);
                    $('#txtTel').val(result.d['TEL']);
                    $('#txtQQ').val(result.d['QQ']);
                    $('#txtMsn').val(result.d['MSN']);

                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //加载个人信息
        var getPersonInfoByUserId = function () {
            $.ajax({
                type: 'get',
                url: '/WebService/WebService.asmx/GetPersonModel',
                contentType: 'application/json;charset=utf-8',
                data: '{}',
                dataType: 'json',
                success: function (result) {
                    $('#txtRealName').val(result.d['REAL_NAME']);
                    $("input[name='rblSex'][value='" + result.d['SEX'] + "']").attr("checked", true);
                    var reg = /[0-9]+/i;
                    var birthday = reg.exec(result.d.BIRTHDAY);
                    var dateTemp = new Date();
                    dateTemp.setTime(birthday);
                    $('#slectYear').val(dateTemp.getFullYear());
                    if (dateTemp.getMonth() + 1 < 10) {
                        $('#selectMonth').val('0' + (dateTemp.getMonth() + 1));
                    }
                    yearMonth();
                    if (dateTemp.getDay() < 10) {
                        $('#selectDate').val('0' + dateTemp.getDay());
                    }
                    $('#selEducation').val(result.d.DEGREE);
                    $('#selCardType').val(result.d.ID_TYPE);
                    $('#txtCardId').val(result.d.ID_CODE);
                    var str = result.d.LIKES.split(',');
                    for (var strindex in str) {
                        $("input[name='cbkLikes'][value='" + str[strindex] + "']").attr("checked", true);
                    }
                    if (result.d['AREA_CODE'] != "") {
                        $('#selArea').show();
                        getArea(result.d['AREA_CODE']);
                        getCity(result.d['AREA_CODE']);
                        getProvince(result.d['AREA_CODE']);
                    }
                    else {
                        getProvince("");
                    }
                    //加载城市
                    $('#selProvince').change(function () {
                        $('#selArea').hide();
                        getCity($('#selProvince').val());
                    });
                    $('#selCity').change(function () {
                        $('#selArea').show();
                        getArea($('#selCity').val());
                    });
                    if (result.d.IMAGE_CODE != "") {
                        $('#userImage').attr("src", function () { return "" + result.d.IMAGE_CODE });
                        $('#userImage').attr("alt", function () { return "" + result.d.REAL_NAME });
                        $('#userImage').attr("title", function () { return "" + result.d.REAL_NAME });
                    }
                    else {
                        $('#userImage').attr("src", function () { return "/Images/avatar.jpg" });
                        $('#userImage').attr("alt", function () { return "默认头像" });
                        $('#userImage').attr("title", function () { return "默认头像" });
                    }

                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //加载喜好信息
        var getLikes = function () {
            $.ajax({
                type: 'get',
                url: '/WebService/WebService.asmx/GetLikesModel',
                contentType: 'application/json;charset=utf-8',
                data: '{}',
                dataType: 'json',
                success: function (result) {
                    $(result.d).each(function () {
                        var cb = document.createElement('input');
                        cb.type = "checkbox";
                        cb.id = "lblLikes" + this.AREA_CODE;
                        cb.name = "cbkLikes";
                        cb.value = "" + this.AREA_CODE;
                        var cbxText = document.createElement('label');
                        cbxText.htmlFor = "lblLikes" + this.AREA_CODE
                        cbxText.innerHTML = this.AREA_NAME;
                        $('#likes').append(cb);
                        $('#likes').append(cbxText);
                    });
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //省信息
        var getProvince = function (cityId) {
            $.ajax({
                type: 'post',
                url: '/WebService/WebService.asmx/GetAreaListModel',
                contentType: 'application/json;charset=utf-8',
                data: '{strWhere:"%0000"}',
                dataType: 'json',
                success: function (result) {
                    $(result.d).each(function () {
                        if (this.AREA_CODE != "000000") {
                            var option = document.createElement("option");
                            option.value = this.AREA_CODE;
                            option.innerHTML = this.AREA_NAME;
                            $('#selProvince').append(option);
                        }
                    });
                    if (cityId != "") {
                        $('#selProvince').val(cityId.substring(0, 2) + "0000");
                    }
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //加载城市信息
        var getCity = function (cityId) {
            document.getElementById("selCity").options.length = 1;
            var province = document.getElementById("selProvince").value.substring(0, 2);
            $.ajax({
                type: 'post',
                url: '/WebService/WebService.asmx/GetAreaListModel',
                contentType: 'application/json;charset=utf-8',
                data: '{strWhere:"' + cityId.substring(0, 2) + '%00"}',
                dataType: 'json',
                success: function (result) {
                    $(result.d).each(function () {
                        if (this.AREA_CODE != $('#selProvince').val()) {
                            var option = document.createElement("option");
                            option.value = this.AREA_CODE;
                            option.innerHTML = this.AREA_NAME;
                            $('#selCity').append(option);
                        }
                    });
                    $('#selCity').val(cityId.substring(0, 4) + "00");
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //加载地区信息
        var getArea = function (cityId) {
            document.getElementById("selArea").options.length = 1;
            $.ajax({
                type: 'post',
                url: '/WebService/WebService.asmx/GetAreaListModel',
                contentType: 'application/json;charset=utf-8',
                data: '{strWhere:"' + cityId.substring(0, 4) + '%"}',
                dataType: 'json',
                success: function (result) {
                    $(result.d).each(function () {
                        if (this.AREA_CODE != $('#selCity').val()) {
                            var option = document.createElement("option");
                            option.value = this.AREA_CODE;
                            option.innerHTML = this.AREA_NAME;
                            $('#selArea').append(option);
                        }
                    });
                    $('#selArea').val(cityId);
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        //编辑个人信息
        var editUserAndPersonInfo = function () {
            var mobel = $.trim($('#txtMobel').val());
            var tel = $.trim($('#txtTel').val());
            var qq = $.trim($('#txtQQ').val());
            var msn = $.trim($('#txtMsn').val());
            var userName = $.trim($('#txtuserName').val());
            var realName = $.trim($('#txtRealName').val());
            var sex = $('input:radio[name="rblSex"]:checked').val();
            var birthday = $('#slectYear').val() + '-' + $('#selectMonth').val() + '-' + $('#selectDate').val();
            var area = $('#selArea').val();
            var education = $('#selEducation').val();
            var selCardType = $('#selCardType').val();
            var txtCardId = $('#txtCardId').val();
            var likesValue = '';
            var checkbox = document.getElementsByName("cbkLikes");
            for (var key in checkbox) {
                if (checkbox[key].checked) {
                    likesValue += checkbox[key].value + ",";
                }
            }
            likesValue = likesValue.substring(0, likesValue.length - 1);
            $.ajax({
                type: 'post',
                url: '/WebService/WebService.asmx/UpdateUserInfoAndPerson',
                contentType: 'application/json;charset=utf-8',
                data: '{"mobel":" ' + mobel + '","tel":"' + tel + '","qq":"' + qq + '","msn":"' + msn + '","userName":"' + userName + '","realName":"' + realName + '","sex":"' + sex + '","birthday":"' + birthday + '","area":"' + area + '","education":"' + education + '","cardType":"' + selCardType + '","cardId":"' + txtCardId + '","likes":"' + likesValue + '"}',
                dataType: 'json',
                success: function (result) {
                    if (result.d == "true") {
                        alert('更新成功');
                    }
                    else {
                        alert('更新失败');
                    }
                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
        var loadUserHead = function () {
            $.ajax({
                type: 'get',
                url: '/WebService/WebService.asmx/GetPersonModel',
                contentType: 'application/json;charset=utf-8',
                data: '{}',
                dataType: 'json',
                success: function (result) {
                    if (result.d.IMAGE_CODE != "") {
                        $('#userImage').attr("src", function () { return "" + result.d.IMAGE_CODE });
                        $('#userImage').attr("alt", function () { return "" + result.d.REAL_NAME });
                        $('#userImage').attr("title", function () { return "" + result.d.REAL_NAME });
                    }
                    else {
                        $('#userImage').attr("src", function () { return "/Images/avatar.jpg" });
                        $('#userImage').attr("alt", function () { return "默认头像" });
                        $('#userImage').attr("title", function () { return "默认头像" });
                    }

                },
                error: function (result) {
                    alert(result.responseText);
                }
            });
        }
    </script>
</head>
<body class="body_01">
    <input id="hidPageCount" type="hidden" />
    <div id="divDefaultContent" class="content">
        <!--left-->
        <div id="divDefaultLeft" class="leftside float_l center">
            <!--头像-->
            <div class="photo">
                <a href="#">
                    <img src="../../Images/personl/personal_003/photo.jpg" alt="" /></a>
            </div>
            <!--left-->
            <div class="leftmenu">
                <ul>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="home"><a href="#" title=""></a></span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="menu_01"><a href="#" title=""></a></span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="menu_02"><a href="#" title=""></a></span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="menu_03"><a href="#" title=""></a></span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="menu_04"><a href="#" title=""></a></span></li>
                </ul>
            </div>
            <div class="leftmenu">
                <ul class="bottom">
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="duihua"><a href="#" title=""></a></span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="shezhi"><a style="cursor:pointer" title="个人设置" id="edituserinfo"></a>
                    </span></li>
                    <li onmouseover="this.className='hove'" onmouseout="this.className=''" class=""><span
                        class="chaxun"><a href="#" title=""></a></span></li>
                </ul>
            </div>
        </div>
        <div id="divDefaultRight" class="conRight">
            <!--right-->
            <div class="rightside">
                <!--快捷方式-->
                <div class="icon_fast">
                    <ul>
                        <li class="now" id="defaultclass"><span class="home"><a href="javascript:void(0);"
                            title="首页" id="default"></a></span></li>
                        <li id="eatclass"><span class="eat"><a href="javascript:void(0);" title="好吃的" id="eat">
                        </a></span></li>
                        <li id="playclass"><span class="play"><a href="javascript:void(0);" title="好玩的" id="play">
                        </a></span></li>
                        <li id="activeclass"><span class="active"><a href="javascript:void(0);" title="搞活动"
                            id="active"></a></span></li>
                        <li id="techanclass"><span class="techan"><a href="javascript:void(0);" title="买特产"
                            id="shop"></a></span></li>
                    </ul>
                </div>
                <div>
                    <span class="arrow_up bg_arrow"><a style="cursor: pointer" onclick="MAIN_LIST_DIV_MOVE_DOWN()">
                    </a><a style="cursor: pointer" onclick="DEFAULT_MAIN_LIST_TO_TOP()"></a></span>
                </div>
                <div id="divDefaultMain" class="scrollable vertical" style="overflow: hidden">
                    <div id="divDefaultMainList" style="position: relative;">
                        <div id="newscontent">
                            <img src="/Images/ajax-loader.gif" alt="正在加载，请稍候" />
                            正在加载，请稍候......
                        </div>
                        <div style="text-align: center">
                            <a href="javascript:void(0);" style="cursor: pointer" title="首页" id="firstPage">首页</a>
                            <a href="javascript:void(0);" style="cursor: pointer" title="上一页" id="PrevPage">上一页</a>
                            <a href="javascript:void(0);" style="cursor: pointer" title="下一页" id="nextPage">下一页</a>
                            <a href="javascript:void(0);" style="cursor: pointer" title="末页" id="endPage">末页</a>
                        </div>
                    </div>
                </div>
                <div>
                    <span class="arrow_down bg_arrow"><a style="cursor: pointer" onclick="MAIN_LIST_DIV_MOVE_UP()">
                    </a></span>
                </div>
            </div>
            <!--rightBar-->
            <div class="rightBar float_r">
                <div>
                    <ul class="iconR">
                        <li class="njl"><a onclick="javascript:openPopupDiv()" style="cursor: pointer" title="本地农家乐">
                        </a></li>
                        <li class="village"><a onclick="javascript:openPopupDiv()" style="cursor: pointer"
                            title="本地度假村"></a></li>
                        <li class="theme"><a onclick="javascript:openPopupDiv()" style="cursor: pointer"
                            title="背景墙"></a></li>
                    </ul>
                </div>
            </div>
            <!--弹出层-->
            <div id="divDefaultPopup" class="popup" style="display: none; width: 0px;">
                <!--标题-->
                <div class="popupTit">
                    <span class="float_r close"><a onclick="javascript:closePopupDiv()" style="cursor: pointer"
                        title="关闭"></a></span>
                    <h2>
                        文章正文</h2>
                </div>
                <div>
                    <span class="arrow_up bg_arrow"><a style="cursor: pointer" onclick="CONTENT_DIV_MOVE_DOWN()">
                    </a></span>
                </div>
                <!--文章-->
                <div id="divDefaultPopupContent" style="overflow: hidden;">
                    <div id="divDefaultPopupContentAll" class="articlecont" style="position: relative;">
                        <!--个人信息-->
                        <div id="newsContent">
                            <img src="/Images/ajax-loader.gif" alt="正在加载，请稍候" />
                            正在加载，请稍候......
                        </div>
                        <!--评论-->
                        <div class="pinglun">
                            <!--评论内容-->
                            <div class="cleanFlex" id="newsComment">
                                <img src="/Images/ajax-loader.gif" alt="正在加载，请稍候" />
                                正在加载，请稍候......
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <span class="arrow_down bg_arrow"><a style="cursor: pointer" onclick="CONTENT_DIV_MOVE_UP()">
                    </a></span>
                </div>
            </div>
        </div>
    </div>
    <iframe name="uploadIframe" style="display: none"></iframe>
    <div id="divDefaultOverAll" style="position: absolute; display: none; top: 0px; left: 0px;
        width: 100%; height: 100%; z-index: 999999; background-color: #000000; filter: alpha(opacity=50);
        -moz-opacity: 0.5; -khtml-opacity: 0.5; opacity: 0.5;">
    </div>
    <script type="text/javascript" src="/scripts/jquery-scroll-pack.js"></script>
    <script type="text/javascript" src="/scripts/jquery-njl-default.js"></script>
</body>
</html>
